axios.get(bannerApi, {
    params: {

    }
}).then(res => {
    console.log(res.data, 7878)
    let tm = res.data;
    let htm = "";
    $(function() {
        $.each(tm, function(i, v) {
            console.log(i, v)
            htm +=
                ` 
                <div class="swiper-slide"><img src="${tm[i].bannerImg}" /></div>
              
                
            `

        })
    })
    $(".swiper-wrapper").html(htm);



}).then(function() {
    var mySwiper = new Swiper('.swiper-container', {
        // direction: 'vertical', // 垂直切换选项
        loop: true, // 循环模式选项

        // // 如果需要分页器
        pagination: {
            el: '.swiper-pagination',
        },
        autoplay: {
            delay: 2000,

        }
    })
});



$.ajax({
    url: contentApi,
    type: 'get',
    success: function(res) {

        console.log(res)
        console.log(res.data, 8989);
        let tmp = res;
        let html = "";
        $(function() {
            $.each(tmp, function(i, v) {
                html +=
                    `
                    <aside>
                    <div class="content">
                        <div class="name">
                          <img src = "${tmp[i].headUrl}" />
                          <div >${tmp[i].name}</div>

                        </div>
                        <div class="gambit">
                            <span class="ga1">来自话题</span>
                            <span class="ga2">${tmp[i].title}</span>
                        </div>
                        <div class="intro">
                        ${tmp[i].content}
                            <br/><a>全文</a>
                        </div>
                        <div class="picture">

                            <img src="${tmp[i].topicImages[0].topicImage}"/>
                            <img src="${tmp[i].topicImages[1].topicImage}"/>
                        </div>
                        <div class="bottom">
                            <div class="bot-left">
                                <span class="iconfont icon-dianzan"> ${tmp[i].dianzan}</span>
                                <span class="iconfont icon-pinglun"> ${tmp[i].comment}</span>
                                <span class="iconfont icon-shoucang"> ${tmp[i].collectnum}</span>
                            </div>
                            <div class="bot-right">
                                <span class="iconfont icon-zhuanfa"></span>
                            </div>
                        </div>
                    </div>
                </aside>

                `

            })
            $("article").html(html);
        })
    },
    error: function(error) {
        console.log(error);
    }
})